package tutorial.java.dragdrop;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.border.LineBorder;

import java.awt.Color;

import javax.swing.border.TitledBorder;
import javax.swing.JScrollPane;

public class TableDemo extends JFrame {

	private JPanel contentPane;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TableDemo frame = new TableDemo();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TableDemo() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(102, 50, 242, 116);
		contentPane.add(scrollPane);
		
		table = new JTable();
		scrollPane.setViewportView(table);
//		table.setBorder(new LineBorder(new Color(0, 0, 0)));
		
//		table.setCellSelectionEnabled(true);
//		table.setColumnSelectionAllowed(true);
		
//		loadTable();
	}
	
//	private void loadTable(){
//		DefaultTableModel dataModel = new DefaultTableModel(loadRowData(), loadColumnName());
//		table.setModel(dataModel);
//	}
//	
//	private String[] loadColumnName(){
//		return new String[]{"Title 1", "Title 2"};
//	}
//	
//	private Object[][] loadRowData(){
//		return new Object[][]{{"hai","oanh"},{"vk","ck"}};
//	}
}
